﻿using System;
using RuTracker.Interface.Login;

namespace RuTracker.Interface
{
    public interface ITrackerAccessor
    {
        /// <summary>
        /// Returns true in case if user is already signed in
        /// </summary>
        bool IsSignedIn();

        /// <summary>
        /// signs user into ruTracker. returns true if user was successfully signed into
        /// </summary>
        LoginResults SignIn(string user, string password);

        /// <summary>
        /// Signs user with capture
        /// </summary>
        LoginResults SignInWithCapture(string user, string password, string captchaCode, string captchaCodeValue, string captchaSid);

        /// <summary>
        /// Searches on torrent tracker
        /// </summary>
        LoginResults Search(string query);

        /// <summary>
        /// downloads html page from specific url
        /// </summary>
        LoginResults GoToAddress(string url);

        /// <summary>
        /// Signs user out. returns true if user was signed out successfully
        /// </summary>
        bool SignOut();

        /// <summary>
        /// Gets stream to download torrent file from Url topic
        /// </summary>
        byte[] GetTorrentFromTopic(Uri uri);

        /// <summary>
        /// Gets tracker information
        /// </summary>
        TrackerInformation TrackerInfo { get; }
    }

}
